package org.languageguide.versioncontrol;

import java.sql.SQLException;
import java.util.GregorianCalendar;

public class VersionControlUtil {
	
	public static boolean hasCheckoutExpired(java.sql.Date time) throws SQLException{
		//Date currentTime = new Date();
		GregorianCalendar currentTime = new GregorianCalendar();
		GregorianCalendar checked_outTimeCalendar = new GregorianCalendar();
		checked_outTimeCalendar.setTime(time);
		long diffMillis = currentTime.getTimeInMillis() - checked_outTimeCalendar.getTimeInMillis();
		long secs = diffMillis/(1000);
		if (secs < 7200){
			return false;
		}
		return true;
	}
	
}
